<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
		<script src="js/jQuery3.4.1.js"></script>
		<script src="js/bootstrap.bundle.min.js"></script>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
	</head>
	<body>
		<div class="container">
			<!-- 导航水平对齐  justify-content-center-->
 			<!-- 导航居右对齐 justify-content-end -->
			<!-- 垂直排列 flex-column -->
			<!-- nav-fill 放大----占完 -->
			<ul class="nav nav-pills justify-content-center nav-fill">
				<li class="nav-item"><a href="#" class="nav-link">首页</a></li>
				<li class="nav-item"><a href="#" class="nav-link">新闻</a></li>
				<li class="nav-item">
					<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">教育</a>
					<div class="dropdown-menu">
						<a href="#" class="dropdown-item">中小学</a>
						<a href="#" class="dropdown-item">高考</a>
						<a href="#" class="dropdown-item">大学</a>
						<a href="#" class="dropdown-item">考研</a>
					</div>
				</li>
				<li class="nav-item"><a href="#" class="nav-link">旅游</a></li>
				<li class="nav-item"><a href="#" class="nav-link">科技</a></li>
			</ul>
		</div>
	</body>
</html>
<script type="text/javascript">
	$(function(){
		$('.container>ul>li>a').click(function(){
			// console.log(this)
			$(this).addClass('active').parent().siblings().children('a').removeClass('active')
		});
	})
</script>
